﻿using System;
using System.Collections.Generic;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Web;

namespace MobFlash
{
    public class MyValidator : UserNamePasswordValidator
    {
        /// <summary>
        /// 用户名密码验证
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        public override void Validate(string userName, string password)
        {
            // validate arguments
            if (string.IsNullOrEmpty(userName))
                throw new ArgumentNullException("userName");
            if (string.IsNullOrEmpty(password))
                throw new ArgumentNullException("password");
            // check if the user is not pzjs
            if (userName != "pzjs" || password != "pz36883487")
                throw new SecurityTokenException("用户名或者密码错误！");
        }
    }
}